#!/usr/bin/env python
#coding=utf-8
    
i = 1
while True:
    a = i*2 + 1
    b = (i**2)*2+i*2
    c = b + 1
    temp = 1000%(a+b+c)
    if temp == 0:
        temp = 1000/(a+b+c)
        print a*temp*b*temp*c*temp
        exit()
    elif a+b+c < 1000:
        i += 2
    else:
        break

i = 2        
while True:
    a = i*2
    b = i**2 - 1
    c = b + 2
    temp = 1000%(a+b+c)
    if temp == 0:
        temp = 1000/(a+b+c)
        print a*temp*b*temp*c*temp
        exit()
    elif a+b+c < 1000:
        i += 2
    else:
        break

